<% extends 'public/base.html'%>
<% block content %>
  <div class="album-content layui-container"  id="layer-photos-demo">
    <div class="layui-row">
        <div class="img-info">
          <img src="<< photo_new.imgSrc >>" alt="<< photo_new.imgName >>">
          <div class="title">
            <p class="data">new<span><< photo_new.createTime.strftime("%Y/%m/%d") >></span></p>
            <p class="text"><< photo_new.imgName >></p>
          </div>
        </div>
        <div class="img-list">
          <div class="layui-fluid">
            <div class="layui-row layui-col-space30 space" id="photo_list"></div>
          </div>
          <div id="demo"></div>
        </div>
    </div>
  </div>
<% endblock %>
<% block script%>
      laypage.render({
        elem: 'demo'
        ,count: << photo_num >> //数据总数，从服务端得到
        ,jump: function(obj, first){
            $.ajax({
              url:"<< url_for('main.album') >>",
              data:{page:obj.curr,limit:obj.limit},
              dataType:'json',
              type:'post',
              success:function (res) {
                  if(res.status==0){
                    $('#photo_list').html('');
                    $.each(res.data,function(index,photo){
                      var html_data='<div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3"><div class="item" data-id="'+photo.Id+'"><img lay-src="'+photo.imgSrc+'" class="load"><div class="cont-text"><div class="data">'+photo.createtime+'</div><p class="briefly">'+photo.imgName+'</p></div></div></div>';
                    $('#photo_list').append(html_data);
                    });
                    obj.count=res.count;
                  }
                  else{
                    layer.alert(res.msg)
                  }
              }
          })
         }
      });
      flow.lazyimg({elem:'img.load'});
      layer.photos({
        photos: '#layer-photos-demo',anim: 5
      });
      menu.init();
<% endblock %>